<template>
  <div>
    <el-card class="box-card">
      <!-- 领导人列表区 -->
      <el-table border stripe :data="leadersList" ref="multipleTable"
        :default-sort="{ prop: 'date', order: 'descending' }" style="width: 100%">
        <el-table-column type="index" sortable align="center" label="#" width="50">
        </el-table-column>
        <el-table-column align="center" width="100" prop="name" label="名称">
        </el-table-column>
        <el-table-column align="center" width="200" label="头像(查看大图)">
          <template #default="scope">
            <el-image class="table-td-headPortrait" :src="scope.row.headPortrait"
              :preview-src-list="[scope.row.headPortrait]"></el-image>
          </template>
        </el-table-column>
        <!-- <el-table-column align="center" show-overflow-tooltip prop="mainStory" label="主要事迹">
          <template slot-scope="scope">
            <div>
              <p v-html="scope.row.mainStory"></p>
            </div>
          </template>
        </el-table-column> -->
        <el-table-column align="center" show-overflow-tooltip prop="desc" label="简介">
          <template slot-scope="scope">
            <div>
              <div v-for="(item, index) in scope.row.desc" :key="index">
                {{ item }}
              </div>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script>
import qs from "qs";
export default {
  data() {
    return {
      leadersList: [],
    };
  },
  created() {
    this.getLeaders();
  },
  methods: {
    async getLeaders() {
      const data = await this.$http("/partyHistory/leader");
      if (data.code == 200) {
        this.leadersList = data.data;
      }
      // console.log(this.leadersList);
    },
  },
};
</script>

<style lang="less" scoped>
.table-td-headPortrait {
  width: 80px;
  height: 80px;
}
</style>
